package com.jlpay.openapi.demo.marketing;

import com.jlpay.open.jlpay.sdk.java.model.marketing.request.MerchantActivityBalanceQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.marketing.response.MerchantActivityBalanceQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import com.jlpay.openapi.demo.openmerch.query.MerchBaseInfoQueryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author liaochangyi
 * @date 2025-08-10  13:50
 */
public class MerchantActivityBalanceQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MerchBaseInfoQueryService.class);

    public static void main(String[] args) {
        MerchantActivityBalanceQueryRequest merchantActivityBalanceQueryRequest = buildMerchantActivityBalanceQueryRequest();
        MerchantActivityBalanceQueryResponse response = JlpayOpenApiService.openMerchService()
                .post(merchantActivityBalanceQueryRequest, MerchantActivityBalanceQueryResponse.class);
        LOGGER.info("商户活动余额查询响应:{}", JsonUtils.toString(response));
    }

    private static MerchantActivityBalanceQueryRequest buildMerchantActivityBalanceQueryRequest() {
        MerchantActivityBalanceQueryRequest merchantActivityBalanceQueryRequest = new MerchantActivityBalanceQueryRequest();
        // 商户号
        merchantActivityBalanceQueryRequest.setMerchNo("84940535193A026");
        merchantActivityBalanceQueryRequest.setActId("act610000064");
        return merchantActivityBalanceQueryRequest;
    }
}
